package cn.edu.dlut.port.isp.repostitory;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import cn.edu.dlut.port.isp.bean.M_thp_comp;


// This will be AUTO IMPLEMENTED by Spring into a Bean called userRepository
// CRUD refers Create, Read, Update, Delete

public interface M_thp_compRepository extends CrudRepository<M_thp_comp, Long> {
	/**
     * 扩展,按Comp_id查询
     * @param Comp_id
     * @return
     */
    public List<M_thp_comp> findBycompID(String Comp_id);
    /**
     * 扩展,按date查询
     * @param date
     * @return
     */
    public List<M_thp_comp> queryByDate(Integer date);
    
	@Query("select bean from M_thp_comp bean where floor(bean.date/100)=?1")
    public List<M_thp_comp> queryByYear(Integer year);
    
    
    /*   @Query("select u from User u where u.firstname = :#{#customer.firstname}")
    List<User> findUsersByCustomersFirstname(@Param("customer") Customer customer);*/
}
